<template>
  <el-card class="box_card">
    <div slot="header" class="clearfix"><span>动作属性配置</span></div>
    <div>{{ form.actionName }}</div>
    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="调试顺序">
        <el-select v-model="form.OrderType" size="mini" placeholder="请选择活动区域">
          <el-option v-for="item in enSTrackActOrder" :key="item.key" :label="item.name" :value="item.key">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="触发模式">
        <el-select v-model="form.TriggerMode" size="mini" placeholder="请选择活动区域">
          <el-option v-for="item in enShearerActTriggerMode" :key="item.key" :label="item.name" :value="item.key">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="触发煤机位置">
        <el-input v-model="form.ShearerLoc" size="mini"></el-input>
      </el-form-item>
      <el-form-item label="触发煤机方向" v-if="form.ShearerLoc != 0 && form.ShearerLoc">
        <el-select v-model="form.ShearerDir" size="mini" placeholder="请选择活动区域">
          <el-option v-for="item in enSTrackRunDir" :key="item.key" :label="item.name" :value="item.key">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="有效区间L">
        <el-input v-model.number="form.ActRegionL" size="mini"></el-input>
      </el-form-item>
      <el-form-item label="有效区间H">
        <el-input v-model.number="form.ActRegionH" size="mini"></el-input>
      </el-form-item>
      <el-form-item label="参数组">
        <el-select filterable allow-create default-first-option size="mini" v-model="form.ParaIDs" multiple
          placeholder="请选择" :rules="[{ required: true, message: '请选择', trigger: 'blur' },]">
          <el-option v-for="item in parasIDsCode" :key="item.value" :label=" item.value +' '+item.label"
            :value="item.value">
            <span style="float: left">{{ item.label }}</span>
            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.groupName }}</span>
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="随动距离" v-if="form.RegionType!=0">
        <el-input-number v-model="form._SDLength" controls-position="right"></el-input-number>
      </el-form-item>
      <el-form-item label="随动范围" v-if="form.RegionType!=0">
        <el-input-number v-model="form._SDScope" controls-position="right"></el-input-number>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">更新</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script>
  import enSTrackActOrder from "../data/enSTrackActOrder.js"
  import enShearerActTriggerMode from '../data/enShearerActTriggerMode';
  import parasIDsCode from "../data/paraDataCode.js"
  import enSTrackRunDir from "../data/enSTrackRunDir.js"
  export default {
    props: {
      form: {
        type: Object,
        default: () => {
          return {}
        },
      },
    },
    data() {
      return {
        enSTrackActOrder: enSTrackActOrder,
        parasIDsCode: parasIDsCode,
        enShearerActTriggerMode: enShearerActTriggerMode,
        enSTrackRunDir: enSTrackRunDir
      }
    },
    methods: {
      onSubmit() {
        this.$emit('onSubmit', this.form)
      }
    }
  }
</script>

<style scoped>
</style>
